package com.zs.usc.utils;

import com.zs.usc.vo.CurrentUserInfo;

import java.security.NoSuchAlgorithmException;
import java.util.Random;

/**
 * @author Zero
 * @description token辅助类
 * @date 2021/11/13 10:01
 */
public class TokenUtils {

    public static final String token_prefix = "token:";

    /**
     * 生成token
     *
     * @return
     */
    public static String createToken() {
//        String token = (System.currentTimeMillis() + new Random().nextInt(999999999)) + "";
//        String md5 = EncryptUtils.md5Encode(token);
//        return EncryptUtils.base64Encode(md5.getBytes());
        return token_prefix + UUIDUtils.generate();
    }


    public static void main(String[] args) {
        System.out.println("createToken() = " + createToken());
    }
}
